package nacos.example.config;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;

/**
 * <br/>启用nacos配置中心步骤：
 * <br/>1、maven引入spring-cloud-starter-bootstrap
 * <br/>2、创建bootstrap.yml并配置nacos配置中心相关的内容
 * <br/>
 * <br/>当前类等同于maven引入了spring-cloud-starter-bootstrap
 */
@Configuration
public class CustomNacosConfigDataLoader extends PropertySourceBootstrapConfiguration {

    @Resource
    ConfigurableApplicationContext applicationContext;

    @PostConstruct
    public void init() {
        super.initialize(applicationContext);
    }

}
